package com.xbongbong.saas.service;

import com.xbongbong.paas.domain.entity.ext.PaasFormDataEntityExt;
import com.xbongbong.paas.pojo.dto.LikeAddDTO;
import com.xbongbong.paas.pojo.dto.LikeAddOnCommentDTO;
import com.xbongbong.paas.pojo.dto.LikeListDTO;
import com.xbongbong.paas.pojo.vo.LikeListVO;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.wrap.BaseVO;
import com.xbongbong.paas.toolbox.wrap.UserVO;

import java.util.List;
import java.util.Map;

/**
 * @author haibin.zhang
 * @version v1.0
 * @date 2019/2/27 19:43
 * @since v1.0
 */
public interface LikeService {
    /**
     * 点赞
     * @param likeAddDTO
     * @return
     */
    BaseVO add(LikeAddDTO likeAddDTO) throws XbbException;

    /**
     * Description: 点赞评论下的评论
     * @param likeAddOnCommentDTO
     * @return com.xbongbong.paas.toolbox.wrap.BaseVO
     * @throws XbbException XbbException
     * @author 魏荣杰
     * @date 2019/5/12 14:08
     * @since v1.0
     */
    BaseVO addLikeOnComment(LikeAddOnCommentDTO likeAddOnCommentDTO) throws XbbException;
    /**
     * 点赞数
     * @param corpid
     * @param type
     * @param appId
     * @param dataId
     * @param userId
     * @return
     * @throws XbbException
     */
    Integer getCount(String corpid, Integer type, Long appId, Long dataId, String userId) throws XbbException;

    /**
     * 自己点赞了吗
     * @param corpid
     * @param type
     * @param appId
     * @param dataId
     * @param userId
     * @return
     */
    Boolean getIfLike(String corpid, Integer type, Long appId, Long dataId, String userId) throws XbbException;

    /**
     * 点赞列表
     * @param likeListDTO
     * @return
     */
    LikeListVO list(LikeListDTO likeListDTO) throws XbbException;

    /**
     * 点赞总数map
     * @param dataIdIn
     * @param corpid
     * @param code
     * @return
     */
    Map<Long,Integer> getLikeCountMap(List<Long> dataIdIn, String corpid, Integer code);

    /**
     * 获取我点赞的数据
     * @param dataIdIn
     * @param corpid
     * @param code
     * @param userId
     * @return
     */
    List<Long> hasMyLike(List<Long> dataIdIn, String corpid, Integer code, String userId);

    /**
     * 点赞消息推送
     *
     * @param businessType          业务类型
     * @param corpid                公司id
     * @param dataId                业务数据id
     * @param paasFormDataEntityExt 业务数据
     * @author GuoJun.HU
     * @since V1.0
     * @throws XbbException XbbException
     * @date 2019/4/18 14:16
     */
    void pushLike(UserVO loginUser, Integer businessType, String corpid, Long dataId, PaasFormDataEntityExt paasFormDataEntityExt, Integer distributorMark) throws XbbException;
}
